package my.spring.transaction.status;

/**
 * @author fengbo
 * @date 2018/7/4
 */
public class DefaultTransactionStatus implements TransactionStatus {

    private final Object transaction;

    private final boolean newTransaction;

    private final boolean newSynchronization;

    private final boolean readOnly;

    public DefaultTransactionStatus(Object transaction, boolean newTransaction, boolean newSynchronization, boolean readOnly) {
        this.transaction = transaction;
        this.newTransaction = newTransaction;
        this.newSynchronization = newSynchronization;
        this.readOnly = readOnly;
    }

    public Object getTransaction() {
        return transaction;
    }

    public boolean isNewTransaction() {
        return newTransaction;
    }

    public boolean isNewSynchronization() {
        return newSynchronization;
    }

    public boolean isReadOnly() {
        return readOnly;
    }
}
